Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix macro hygiene #62

Merged
merged 1 commit into from
Jul 13, 2023
Merged

Fix macro hygiene #62

merged 1 commit into from
Jul 13, 2023

Conversation

charleskawczynski
Copy link
Member

Found in https://buildkite.com/clima/climacoupler-ci/builds/1372#01895016-b183-41a3-93fc-fbef7e2cf455/142-211, this PR:

  • Improves the macro hygiene test
  • Fixes some macro hygiene issues

@charleskawczynski charleskawczynski marked this pull request as draft July 13, 2023 18:35
@charleskawczynski
Copy link
Member Author

It ran locally because I forgot to re-dev my test env. Still figuring out how to fix this..

@charleskawczynski
Copy link
Member Author

Ugh, we're running into JuliaLang/julia#37691

@simonbyrne
Copy link
Member

what's the issue?

@simonbyrne
Copy link
Member

Oh, @threads....

@charleskawczynski
Copy link
Member Author

charleskawczynski commented Jul 13, 2023

Yeah, from https://discourse.julialang.org/t/optional-macro-invocation/18588/21?page=2:

macro threaded(device, loop)
    quote
        if $(esc(device)) isa CPUMultiThreaded
            Threads.@threads $(Expr(
                loop.head,
                Expr(loop.args[1].head, esc.(loop.args[1].args)...),
                esc(loop.args[2]),
            ))
        else
            @assert $(esc(device)) isa AbstractDevice
            $(esc(loop))
        end
    end
end

seems to work. It's not quite as pretty though.. Thoughts @simonbyrne ?

Fix macro hygiene

Bump patch version
@simonbyrne
Copy link
Member

that might be the least-worst solution

@charleskawczynski charleskawczynski marked this pull request as ready for review July 13, 2023 21:13
@charleskawczynski charleskawczynski merged commit 5381b8a into main Jul 13, 2023
4 checks passed
@simonbyrne simonbyrne deleted the ck/tests branch July 13, 2023 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants